@model IEnumerable<WebApplication1.Models.Product>

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
</head>
<body>
<p>
    <a asp-action="Create">Create New</a>
</p>
<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Price)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Manufacturer)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
@foreach (var item in Model) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Price)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Manufacturer.ManufacturerID)
            </td>
            <td>
                <a asp-action="Edit" asp-route-id="@item.ProductID">Edit</a> |
                <a asp-action="Details" asp-route-id="@item.ProductID">Details</a> |
                <a asp-action="Delete" asp-route-id="@item.ProductID">Delete</a>
            </td>
        </tr>
}
    </tbody>
</table>
</body>
</html>
